import java.sql.*;
public class StuNumber {
    public static void main(String args[]) {
        Connection con=null;
        Statement sql;
        ResultSet rs;
        String uri = "jdbc:mysql://localhost:3306/world";
        String user ="root";
        String password ="";
        try{
            con = DriverManager.getConnection(uri,user,password);
        }
        catch(SQLException e){
            System.out.println(e);
        }
        try {
            if (con == null) return;
            String c=" Population>=3016523";
            sql=con.createStatement();
            String sqlStr = "select * from city where"+c;
            rs=sql.executeQuery(sqlStr);
            while(rs.next()) {
                int ID=rs.getInt(1);
                String Name=rs.getString(2);
                String CountryCode=rs.getString(3);
                String District=rs.getString(4);
                int Population=rs.getInt(5);
                System.out.printf("%d\t",ID);
                System.out.printf("%s\t",Name);
                System.out.printf("%s\t",CountryCode);
                System.out.printf("%s\t",District);
                System.out.printf("%d\n",Population);
            }
            con.close();
        }
        catch(SQLException e) {
            System.out.println(e);
        }
    }
}
